package com.ruoyi.exam.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.exam.mapper.ExamPaperQuestionMapper;
import com.ruoyi.exam.domain.entity.ExamPaperQuestion;
import com.ruoyi.exam.service.IExamPaperQuestionService;

/**
 * 试卷的题目详情Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-12-18
 */
@Service
public class ExamPaperQuestionServiceImpl implements IExamPaperQuestionService {
    @Autowired
    private ExamPaperQuestionMapper examPaperQuestionMapper;

    /**
     * 查询试卷的题目详情
     * 
     * @param id 试卷的题目详情主键
     * @return 试卷的题目详情
     */
    @Override
    public ExamPaperQuestion selectExamPaperQuestionById(Long id) {
        return examPaperQuestionMapper.selectExamPaperQuestionById(id);
    }

    /**
     * 查询试卷的题目详情列表
     * 
     * @param examPaperQuestion 试卷的题目详情
     * @return 试卷的题目详情
     */
    @Override
    public List<ExamPaperQuestion> selectExamPaperQuestionList(ExamPaperQuestion examPaperQuestion) {
        return examPaperQuestionMapper.selectExamPaperQuestionList(examPaperQuestion);
    }

    /**
     * 新增试卷的题目详情
     * 
     * @param examPaperQuestion 试卷的题目详情
     * @return 结果
     */
    @Override
    public int insertExamPaperQuestion(ExamPaperQuestion examPaperQuestion) {
        examPaperQuestion.setCreateTime(DateUtils.getNowDate());
        return examPaperQuestionMapper.insertExamPaperQuestion(examPaperQuestion);
    }

    /**
     * 修改试卷的题目详情
     * 
     * @param examPaperQuestion 试卷的题目详情
     * @return 结果
     */
    @Override
    public int updateExamPaperQuestion(ExamPaperQuestion examPaperQuestion) {
        examPaperQuestion.setUpdateTime(DateUtils.getNowDate());
        return examPaperQuestionMapper.updateExamPaperQuestion(examPaperQuestion);
    }

    /**
     * 批量删除试卷的题目详情
     * 
     * @param ids 需要删除的试卷的题目详情主键
     * @return 结果
     */
    @Override
    public int deleteExamPaperQuestionByIds(Long[] ids) {
        return examPaperQuestionMapper.deleteExamPaperQuestionByIds(ids);
    }

    /**
     * 删除试卷的题目详情信息
     * 
     * @param id 试卷的题目详情主键
     * @return 结果
     */
    @Override
    public int deleteExamPaperQuestionById(Long id) {
        return examPaperQuestionMapper.deleteExamPaperQuestionById(id);
    }
}
